package com.common.config;

import com.common.controller.MyFilter;
import com.common.controller.TestServlet;
import org.springframework.web.WebApplicationInitializer;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;

/**
 * @classDescription:
 * @author:xiayingjie
 * @createTime:16/8/13
 */

public class MyInitializer implements WebApplicationInitializer{
    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        System.out.printf("world");
        ServletRegistration.Dynamic dynamic=servletContext.addServlet("mytest",TestServlet.class);
        dynamic.addMapping("/good");
     //   servletContext.addFilter("myfilter", MyFilter.class).addMappingForUrlPatterns(null,false,"/opt/*");

    }
}
